-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix shell generation panic due to unnecessary 'conflicts_with' #2934
Conversation
@@ -278,7 +278,6 @@ impl ProgramV4SubCommands for App<'_, '_> { | |||
Arg::with_name("all") | |||
.long("all") | |||
.conflicts_with("account") | |||
.conflicts_with("buffer_authority") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pgarg66 it's supposed to be .conflicts_with("authority")
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I push up that change so we can merge this? May as well fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. It should've been the authority
. Likely a copy-paste error from program.rs
.
Thanks for catching it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed the change to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Problem
solana completions -s zsh
currently panics when trying to generate zsh completions.The root cause is the below code which defines a conflicting arg
buffer_authority
forsolana program-v4 show
, howeverbuffer_authority
is not an argument inprogram-v4 show
:agave/cli/src/program_v4.rs
Lines 277 to 283 in fc0183d
This results in clap panicking due to
find_any_arg
returningNone
, but the calling macro usesexpect()
https://github.com/clap-rs/clap/blob/v2.33.3/src/completions/macros.rs#L15
https://github.com/clap-rs/clap/blob/v2.33.3/src/app/parser.rs#L2168-L2179
Summary of Changes
.conflicts_with("buffer_authority")
with.conflicts_with("authority")
inprogram-v4 show
Fixes #2929